package com.mucfc.crm;

import com.mucfc.crm.dubboinf.CrmCouponService;
import com.mucfc.crm.dubboinf.HelloService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.transaction.TransactionConfiguration;


/**
 * Created by HuQingmiao on 2015/4/7.
 */
public class CrmClient {
    private static Logger log = LoggerFactory.getLogger(CrmClient.class);

    private static ApplicationContext context = new ClassPathXmlApplicationContext(
            new String[]{"crm-dubbo-consumer.xml"});

    @Test
    public void testHello() {
        HelloService helloService = (HelloService) context.getBean("helloService");
        log.info("client: " + helloService.sayHello("Walker"));
    }

    @Test
    public void testCrmCoupon() {
        CrmCouponService crmCouponService = (CrmCouponService) context.getBean("crmCouponService");
        crmCouponService.feedBackSendResult(2015091600000001L, "ACTIVITY-20150afs0000", "succ", null, null);
        log.info(">>>>>>>>> CRM已成功接收到派券反馈！");
    }
}
